﻿namespace A14_EX01_4
{
    using System;

    public class Program
    {
        public static void Main()
        {
            int intNumberFromString = -1;
            bool isPrime = false;
            UserInterface.StartUserDialog();
            string inputString = UserInterface.ReadInput();
            bool isBinaryString = StringCalcFunctions.IsBinary(inputString);
            bool have5Chars = StringCalcFunctions.Have5Chars(inputString);

            if (isBinaryString && have5Chars)
            {
                intNumberFromString = StringCalcFunctions.Convert5BinaryCharsStringToInt(inputString);
                isPrime = StringCalcFunctions.Is5DigitsNumberIsPrime(intNumberFromString);
            }

            UserInterface.FinishUserDialog(isBinaryString, have5Chars, intNumberFromString, isPrime);

            // wait for enter
            Console.WriteLine("Please press 'Enter' to exit...");
            Console.ReadLine();
        }
    }
}